package com.jier.service.impl;

import com.jier.common.Page;
import com.jier.common.Result;
import com.jier.dao.UserDao;
import com.jier.dto.BaseParamDto;
import com.jier.entities.User;
import com.jier.service.IUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 用户
 *
 * @author Administrator
 * @date 2016/8/22
 */
@Service
@Transactional(rollbackFor = RuntimeException.class)
public class UserServiceImpl extends BaseServiceImpl<UserDao, User> implements IUserService {
    /**
     * 分页查询
     *
     * @param keyword
     * @param page
     * @return
     * @throws Exception
     */
    @Override
    public Result loadUsersByPage(String keyword, Page page) throws Exception {
        BaseParamDto param = new BaseParamDto();
        Result result = getRecordPage("loadUsersByPage", page, param);
        return result;
    }

    @Override
    public User login(Integer id, String password) throws Exception {
        return mapper.login(id, password);
    }

    @Override
    public boolean updateUser(String userId, String userName, String age) throws Exception {
        return false;
    }
}

